﻿Imports System
Imports System.ComponentModel
Imports System.Security
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Imports System.ComponentModel.Design
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.Drawing.Design

<Assembly: TagPrefix("Lnc.Web.Social.Twitter.Javascript", "twt")> 
Namespace Twitter.Javascript

#Region "Controles"

    ''' <summary>
    ''' Boton de Twittear (Javascript)
    ''' </summary>
    ''' <remarks>
    ''' Este control requiere insertar primero el control "TwitterScript" entre las 
    ''' etiquetas <HEAD></HEAD> de la pagina
    ''' 
    ''' El equipo de LNC Producciones
    ''' </remarks>
    <Designer(GetType(TweetButtonDesinger)), _
    Description("Boton de Twittear (Javascript)"), _
    AspNetHostingPermission( _
    SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    AspNetHostingPermission( _
    SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    Utils.ToolboxTabName("Twitter:JS"), _
    ToolboxData("<{0}:TweetButton ID=""TweetButton"" runat=""server""></{0}:TweetButton>")> _
    <ToolboxBitmap(GetType(ResourceFinder), "TweetButton.bmp")> _
    Public Class TweetButton
        Inherits WebControl

#Region "Propiedades"
        Shadows Property Style As Common.TweetButtonTypes = Common.TweetButtonTypes.Original

        'Estos son parametros del QueryString de https://twitter.com/share
        ''' <summary>
        ''' URL a twitear
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Puede utilizar el abreviado "http://bit.ly/palabra-clave" para resumir una URL, para ello recuerde utilizar adicionalmente el parametro COUNT-URL para indicar el URL real</remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("URL a twittear."), _
        Editor("System.Web.UI.Design.UrlEditor", GetType(System.Drawing.Design.UITypeEditor))> _
        Property Url As String = ""
        ''' <summary>
        ''' Cuenta asociada al tweet
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue("lncproducciones"), _
        Description("Cuenta asociada al Tweet.")> _
        Property Via As String = ""
        ''' <summary>
        ''' Texto a mostrar al twitear
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("Texto a mostrar al twittear.")> _
        Property Text As String = ""
        ''' <summary>
        ''' Cuentas relacionadas al tweet
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("Cuentas relacionadas al Tweet.")> _
        Property Related As New List(Of String)
        ''' <summary>
        ''' Posicion del contador de tweets
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.TweetButtonCountValues.Horizontal), _
        Description("Posicion del contador de Tweets.")> _
        Property Count As Common.TweetButtonCountValues = Common.TweetButtonCountValues.Horizontal
        ''' <summary>
        ''' Idioma del tweet
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.TweetButtonLanguage.Espanol), _
        Description("Idioma del Tweet.")> _
        Property Language As Common.TweetButtonLanguage = Common.TweetButtonLanguage.Espanol
        ''' <summary>
        ''' URL larga del URL a twitear
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("URL larga del URL a twittear."), _
        Editor("System.Web.UI.Design.UrlEditor", GetType(System.Drawing.Design.UITypeEditor))> _
        Property CountUrl As String = ""
        ''' <summary>
        ''' Palabra(s) clave (para menciones)
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("Palabra(s) clave (para menciones).")> _
        Property Hashtag As String = ""
        ''' <summary>
        ''' Texto a mostrar por cada hashtag
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("Texto a mostrar por cada hashtag.")> _
        Property HashtagText As String = ""
        ''' <summary>
        ''' Tamaño del boton final (mediano, grande)
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.TweetButtonSizes.Medium), _
        Description("Tamaño del boton final (mediano, grande)")> _
        Property Size As Common.TweetButtonSizes = Common.TweetButtonSizes.Medium
#End Region

#Region "Constructores"
        ''' <summary>
        ''' Crea un nuevo boton de Twitear
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()
            MyBase.New()
        End Sub

        ''' <summary>
        ''' Crea un nuevo boton de Twitear
        ''' </summary>
        ''' <param name="ButtonStyle">Estilo del boton</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal ButtonStyle As Common.TweetButtonTypes)
            MyBase.New()
            Style = ButtonStyle
        End Sub

#End Region

#Region "Metodos"

        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            Dim text As String = ""
            Select Case Style
                Case Common.TweetButtonTypes.Original
                    text = "<a href=""" & GetButtonHref() & """ class=""" & GetButtonClass() & """ data-lang=""" & GetButtonLanguage() & """"
                    If Url.Trim <> "" Then text &= " data-url=""" & Url.Trim & """"
                    If CountUrl.Trim <> "" Then text &= " data-counturl=""" & CountUrl & """"
                    If Via.Trim <> "" Then text &= " data-via=""" & Via.Trim & """"
                    If text.Trim <> "" Then text &= " data-text=""" & text.Trim & """"
                    If Related.Count <> 0 Then text &= " data-related=""" & GetRelated() & """"
                    text &= " data-count=""" & GetBoxPosition() & """"
                    text &= " data-size=""" & GetButtonSize() & """"
                    text &= ">" & GetLinkText() & "</a>"
                Case Common.TweetButtonTypes.Hashtag
                    text = "<a href=""" & GetButtonHref() & """ class=""" & GetButtonClass() & """ data-lang=""" & GetButtonLanguage() & """"
                    If Related.Count <> 0 Then text &= " data-related=""" & GetRelated() & """"
                    text &= " data-size=""" & GetButtonSize() & """"
                    text &= ">" & GetLinkText() & " #" & Hashtag & "</a>"
                Case Common.TweetButtonTypes.Mention
                    text = "<a href=""" & GetButtonHref() & """ class=""" & GetButtonClass() & """ data-lang=""" & GetButtonLanguage() & """"
                    If Related.Count <> 0 Then text &= " data-related=""" & GetRelated() & """"
                    text &= " data-size=""" & GetButtonSize() & """"
                    text &= ">" & GetLinkText() & Via & "</a>"
            End Select
            writer.WriteLine(text)
        End Sub

#End Region

#Region "Funciones"

        Private Function GetButtonHref() As String
            Select Case Style
                Case Common.TweetButtonTypes.Original
                    Return "https://twitter.com/share"
                Case Common.TweetButtonTypes.Hashtag
                    Return "https://twitter.com/intent/tweet?button_hashtag=" & Hashtag & "&text=" & HashtagText.Replace(" ", "%20")
                Case Common.TweetButtonTypes.Mention
                    Return "https://twitter.com/intent/tweet?screen_name=" & Via
                Case Else
                    Return "https://twitter.com/share"
            End Select
        End Function

        Private Function GetButtonClass() As String
            Select Case Style
                Case Common.TweetButtonTypes.Original
                    Return "twitter-share-button"
                Case Common.TweetButtonTypes.Hashtag
                    Return "twitter-hashtag-button"
                Case Common.TweetButtonTypes.Original
                    Return "twitter-mention-button"
                Case Else
                    Return "twitter-share-button"
            End Select
        End Function

        Private Function GetButtonLanguage() As String
            If Language = Common.TweetButtonLanguage.Espanol Then
                Return "es"
            Else : Return "en"
            End If
        End Function

        Private Function GetRelated() As String
            If Related.Count <> 0 Then
                Dim data As String = ""
                Dim v As Integer = 0
                For Each r As String In Related
                    v += 1
                    data &= r
                    If v < Related.Count Then data &= ","
                Next
                Return data
            Else
                Return ""
            End If
        End Function

        Private Function GetBoxPosition() As String
            Select Case Count
                Case Common.TweetButtonCountValues.None : Return "none"
                Case Common.TweetButtonCountValues.Horizontal : Return "horizontal"
                Case Common.TweetButtonCountValues.Vertical : Return "vertical"
                Case Else : Return "none"
            End Select
        End Function

        Private Function GetLinkText() As String
            If Style <> Common.TweetButtonTypes.Mention Then
                If Language = Common.TweetButtonLanguage.Espanol Then : Return "Twitear"
                Else : Return "Tweet"
                End If
            Else
                If Language = Common.TweetButtonLanguage.Espanol Then : Return "Twitear a @"
                Else : Return "Tweet to @"
                End If
            End If
        End Function

        Private Function GetButtonSize() As String
            Return IIf(Size = Common.TweetButtonSizes.Medium, "medium", "large")
        End Function

#End Region

    End Class

    ''' <summary>
    ''' Boton de Seguir (Javascript)
    ''' </summary>
    ''' <remarks>
    ''' Este control requiere insertar primero el control "TwitterScript" entre las 
    ''' etiquetas <HEAD></HEAD> de la pagina
    ''' 
    ''' El equipo de LNC Producciones
    ''' </remarks>
    <Designer(GetType(FollowButtonDesinger)), _
    Description("Boton de Seguir (Javascript)"), _
    AspNetHostingPermission( _
    SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    AspNetHostingPermission( _
    SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    Utils.ToolboxTabName("Twitter:JS"), _
    ToolboxData("<{0}:FollowButton ID=""FollowButton"" runat=""server""></{0}:FollowButton>")> _
    <ToolboxBitmap(GetType(ResourceFinder), "FollowButton.bmp")> _
    Public Class FollowButton
        Inherits WebControl

#Region "Propiedades"
        ''' <summary>
        ''' Nombre de la cuenta a seguir
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue("lncproducciones"), _
        Description("Nombre de la cuenta a seguir.")> _
        Public Property ScreenName As String = "lncproducciones"
        ''' <summary>
        ''' Mostrar el conteo de los seguidores
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(False), _
        Description("Mostrar el conteo de los seguidores.")> _
        Public Property ShowCount As Boolean = False
        ''' <summary>
        ''' Idioma del boton
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.TweetButtonLanguage.Espanol), _
        Description("Idioma del boton.")> _
        Public Property Language As Common.TweetButtonLanguage = Common.TweetButtonLanguage.Espanol
        ''' <summary>
        ''' Ancho del boton, en numero o porcentaje
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Solo funciona en la version Javascript del boton</remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue("250px"), _
        Description("Ancho del boton, en numero o porcentaje.")> _
        Public Overrides Property Width As Unit = 250
        ''' <summary>
        ''' Alineacion del texto
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Solo funciona en la version Javascript del boton</remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.FollowButtonAlign.Left), _
        Description("Alineacion del texto.")> _
        Public Property Align As Common.FollowButtonAlign = Common.FollowButtonAlign.Left
        ''' <summary>
        ''' Mostrar el nombre de usuario a seguir
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(True), _
        Description("Mostrar el nombre de usuario a seguir.")> _
        Public Property ShowScreenName As Boolean = True
#End Region

#Region "Constructores"

        ''' <summary>
        ''' Crea un nuevo boton de seguir
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub New()
            MyBase.New()
        End Sub

#End Region

#Region "Metodos"

        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            Dim text As String = ""
            text = "<a href=""https://twitter.com/" & ScreenName & """ class=""twitter-follow-button"""
            If ShowCount = True Then text &= " data-show-count=""true"""
            Text &= " data-lang=""" & GetButtonLanguage() & """"
            If Width.Value > 0 Then text &= " data-width=""" & Width.Value & """"
            Text &= " data-align=""" & GetButtonAlign() & """"
            If ShowScreenName = False Then text &= " data-show-screen-name=""false"""
            text &= ">" & GetLinkText() & ScreenName & "</a>"
            Text &= Common.Functions.GetScript
            writer.WriteLine(text)
        End Sub

#End Region

#Region "Funciones"

        Private Function GetButtonLanguage() As String
            If Language = Common.TweetButtonLanguage.Espanol Then
                Return "es"
            Else : Return "en"
            End If
        End Function

        Private Function GetButtonAlign() As String
            Return IIf(Align = Common.FollowButtonAlign.Right, "right", "left")
        End Function

        Private Function GetLinkText() As String
            If Language = Common.TweetButtonLanguage.Espanol Then : Return "Seguir a @"
            Else : Return "Follow @"
            End If
        End Function

#End Region

    End Class

    ''' <summary>Widget (Javascript)</summary>
    ''' <remarks>
    ''' Este control requiere insertar primero el control "TwitterScript" entre las 
    ''' etiquetas <HEAD></HEAD> de la pagina
    ''' 
    ''' El equipo de LNC Producciones
    ''' </remarks>
    <Designer(GetType(WidgetDesinger)), _
    Description("Widget (Javascript)"), _
    AspNetHostingPermission( _
    SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    AspNetHostingPermission( _
    SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal), _
    Utils.ToolboxTabName("Twitter:JS"), _
    ToolboxData("<{0}:Widget ID=""Widget"" runat=""server""></{0}:Widget>")> _
    <ToolboxBitmap(GetType(ResourceFinder), "TwitterWidget.bmp")> _
    Public Class Widget
        Inherits WebControl

#Region "Propiedades"
        ''' <summary>
        ''' Indica el tipo de widget a crear
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.WidgetTypes.Profile), _
        Description("Tipo de widget a crear.")> _
        Public Property Type As Common.WidgetTypes = Common.WidgetTypes.Profile
        <Browsable(True), Category("Atributos"), _
        DefaultValue("lncproducciones"), _
        Description("Nombre de usuario.")> _
        Public Property ScreenName As String = ""
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("")> _
        Public Property SearchProperties_Search As String = ""
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("")> _
        Public Property SearchProperties_Title As String = ""
        <Browsable(True), Category("Atributos"), _
        DefaultValue(""), _
        Description("")> _
        Public Property SearchProperties_Subject As String = ""
        <Browsable(True), Category("Atributos"), _
        DefaultValue(30000), _
        Description("Intervalo de actualizacion (en milisegundos).")> _
        Public Property Interval As Long = 30000
        <Browsable(True), Category("Atributos"), _
        DefaultValue(250), _
        Description("Ancho del widget.")> _
        Public Overrides Property Width As Unit = 250
        <Browsable(True), Category("Atributos"), _
        DefaultValue(300), _
        Description("Alto del widget.")> _
        Public Overrides Property Height As Unit = 300
        <Browsable(True), Category("Atributos"), _
        DefaultValue("gray"), _
        Description("Color de fondo del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Shell_Background As System.Drawing.Color = Drawing.Color.Gray
        <Browsable(True), Category("Atributos"), _
        DefaultValue("black"), _
        Description("Color de letra del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Shell_Color As System.Drawing.Color = Drawing.Color.Black
        <Browsable(True), Category("Atributos"), _
        DefaultValue("navy"), _
        Description("Color de enlaces del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Shell_Links As System.Drawing.Color = Drawing.Color.Navy
        <Browsable(True), Category("Atributos"), _
        DefaultValue("gray"), _
        Description("Color de fondo del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Tweets_Background As System.Drawing.Color = Drawing.Color.Gray
        <Browsable(True), Category("Atributos"), _
        DefaultValue("black"), _
        Description("Color de letra del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Tweets_Color As System.Drawing.Color = Drawing.Color.Black
        <Browsable(True), Category("Atributos"), _
        DefaultValue("navy"), _
        Description("Color de enlaces del plugin."), _
        Editor("System.Web.UI.Design.ColorBuilder", GetType(System.Drawing.Design.UITypeEditor))> _
        Public Property Tweets_Links As System.Drawing.Color = Drawing.Color.Navy
        <Browsable(True), Category("Atributos"), _
        DefaultValue(False), _
        Description("Indica si se mostrara la bara de desplazamiento")> _
        Public Property Scrollbar As Boolean = False
        <Browsable(True), Category("Atributos"), _
        DefaultValue(False), _
        Description("Indica si se recargara infinitamente el ciclo")> _
        Public Property DoLoop As Boolean = False
        <Browsable(True), Category("Atributos"), _
        DefaultValue(False), _
        Description("Indica si se actualizara en tiempo real")> _
        Public Property Live As Boolean = False
        <Browsable(True), Category("Atributos"), _
        DefaultValue(Common.WidgetBehaviors.All), _
        Description("")> _
        Public Property Behavior As Common.WidgetBehaviors = Common.WidgetBehaviors.All
        <Browsable(True), Category("Atributos"), _
        DefaultValue(5), _
        Description("Numero de Tweets a mostrar")> _
        Public Property TweetsToShow As Integer = 5
#End Region

#Region "Constructores"

        Public Sub New()
            MyBase.New()
        End Sub

        Public Sub New(ByVal User As String)
            MyBase.New()
            ScreenName = User
            Type = Common.WidgetTypes.Profile
            Behavior = Common.WidgetBehaviors.All
        End Sub

#End Region

#Region "Metodos"

        Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
            Dim text As String = vbCrLf
            text &= "<script src=""http://widgets.twimg.com/j/2/widget.js""></script>" & vbCrLf
            text &= "<script>" & vbCrLf
            text &= "   new TWTR.Widget({" & vbCrLf
            text &= "       version: 2," & vbCrLf
            text &= "       type: '" & IIf(Type = Common.WidgetTypes.Profile, "profile", "search") & "'," & vbCrLf
            If Type = Common.WidgetTypes.Search Then
                text &= "       search: '" & SearchProperties_Search & "'," & vbCrLf
                text &= "       title: '" & SearchProperties_Title & "'," & vbCrLf
                text &= "       subject: '" & SearchProperties_Subject & "'," & vbCrLf
            Else
                text &= "       rpp: " & TweetsToShow & "," & vbCrLf
            End If
            text &= "       interval: " & Interval & "," & vbCrLf
            text &= "       width: " & Width.Value & "," & vbCrLf
            text &= "       height: " & Height.Value & "," & vbCrLf
            text &= "       theme: {" & vbCrLf
            text &= "           shell: {" & vbCrLf
            text &= "               background: '" & ColorTranslator.ToHtml(Shell_Background) & "'," & vbCrLf
            text &= "               color: '" & ColorTranslator.ToHtml(Shell_Color) & "'" & vbCrLf
            text &= "           }," & vbCrLf
            text &= "           tweets: {" & vbCrLf
            text &= "               background: '" & ColorTranslator.ToHtml(Tweets_Background) & "'," & vbCrLf
            text &= "               color: '" & ColorTranslator.ToHtml(Tweets_Color) & "'," & vbCrLf
            text &= "               links: '" & ColorTranslator.ToHtml(Tweets_Links) & "'" & vbCrLf
            text &= "           }" & vbCrLf
            text &= "       }," & vbCrLf
            text &= "       features: {" & vbCrLf
            text &= "           scrollbar: " & Utils.Funciones.ToHtmlBoolean(Scrollbar) & "," & vbCrLf
            text &= "           loop: " & Utils.Funciones.ToHtmlBoolean(DoLoop) & "," & vbCrLf
            text &= "           live: " & Utils.Funciones.ToHtmlBoolean(Live) & "," & vbCrLf
            text &= "           behavior: '" & GetBehavior() & "'" & vbCrLf
            text &= "       }" & vbCrLf
            If Type = Common.WidgetTypes.Profile Then
                text &= "   }).render().setUser('" & ScreenName & "').start();" & vbCrLf
            Else
                text &= "   }).render().start();" & vbCrLf
            End If
            text &= "</script>"
            writer.WriteLine(text)
        End Sub

#End Region

#Region "Funciones"

        Public Function GetScrollbar() As String
            Return IIf(Scrollbar = True, "true", "false")
        End Function

        Public Function GetLoop() As String
            Return IIf(DoLoop = True, "true", "false")
        End Function

        Public Function GetLive() As String
            Return IIf(Live = True, "true", "false")
        End Function

        Public Function GetBehavior() As String
            Return IIf(Behavior = Common.WidgetBehaviors.All, "all", "default")
        End Function

#End Region

    End Class

#End Region

#Region "Diseñadores"

    Public Class TweetButtonDesinger
        Inherits ControlDesigner

        Public Overrides Function GetDesignTimeHtml() As String
            Dim out As String = ""
            out = String.Format("<button style=""color: Black; background-color: #F7F7F7; font-size: 8pt;"">twt:<strong>TweetButton</strong></button>")
            Return out
        End Function

    End Class

    Public Class FollowButtonDesinger
        Inherits ControlDesigner

        Public Overrides Function GetDesignTimeHtml() As String
            Dim out As String = ""
            out = String.Format("<button style=""color: Black; background-color: #F7F7F7; font-size: 8pt;"">twt:<strong>FollowButton</strong></button>")
            Return out
        End Function

    End Class

    Public Class WidgetDesinger
        Inherits ControlDesigner

        Public Overrides Function GetDesignTimeHtml() As String
            Dim out As String = ""
            out = String.Format("<button style=""color: Black; background-color: #F7F7F7; font-size: 8pt;"">twt:<strong>Widget</strong></button>")
            Return out
        End Function

    End Class

#End Region

End Namespace